﻿/*#include <iostream>
using namespace  std;
int main()
{
	int a = 10;
	int* p = &a;
	int** pa = &p;
	a = 20;
	cout << **pa << endl;//**pa==a=*p，**pa是解引用*pa再解引用p
	return 0;
}
#include <iostream>
using namespace  std;
int main()
{
	int a = 10;
	//int* p = &a;
	int b = 20;
	//int* p1 = &b;
	int c = 20;
	//int* p2 = &c;
	int* arr[3] = { &a,&b,&c };//指针数组
	for (int i = 0; i < 3; i++)
	{
		cout << *arr[i] << " ";
	}
	return 0;
}
#include <iostream>
using namespace  std;
int main()
{
	int arr1[] = { 1,2,3,4,5 };
	int arr2[] = { 2,3,4,5 ,6};
	int arr3[] = { 3,4,5,6,7 };
	int* arr[3] = { arr1,arr2,arr3 };
	for (int i = 0; i < 3; i++)	
	{
		for (int j = 0; j < 5; j++)
		{
			cout << arr[i][j] << " ";//指针数组
		}
		cout << endl;
	}
	return 0;
}*/
#include <iostream>
using namespace  std;
int main() {
	char ch = 'w';
	char* p1= &ch;
	char arr[] = "abcdef";
	char* p2 = arr;
	const char* p3 = "abcdef";//直接这样子写表示常量字符串，使用const
	//p3存放的是首字符a的地址
	cout << *p3 << " " << p3<<endl;//a abcdef
	printf("%c ", *p3);//因为是c,打印a
	printf("%s\n", p3);//因为是s，所以从a开始打印，abcdef，是字符串的地址
	return 0;
}
